function [P1] = Select(P, proportion, PopSize)
    P = SortP(P);
    %P=P(floor(1:proportion*length(P)),:);
    min = 2000000;
    max = 0.01;
    sum = 0;
    
    for i= 1:length(P)
        sum = sum + P(i).val;
        if min > P(i).val
            min = P(i).val;
        end
        if max < P(i).val && P(i).val < 100
            max = P(i).val;
        end
    end
    avr = sum / length(P);
    range = max - min;
    P1 = P;
    x = ceil(0.1*PopSize);
    while x < PopSize
        
        for i= 1:length(P)
            poss = proportion * ((PopSize-i)/PopSize)^1.5;
            if poss > rand(1)
                P1(x) = P(i);
                x = x+1;
            end
        end
    end
    
end

